package com.example.mybatisplus.service.impl;

import com.example.mybatisplus.model.domain.Work;
import com.example.mybatisplus.mapper.WorkMapper;
import com.example.mybatisplus.service.WorkService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * ֵ����Ϣ�� 服务实现类
 * </p>
 *
 * @author lxp
 * @since 2023-10-16
 */
@Service
public class WorkServiceImpl extends ServiceImpl<WorkMapper, Work> implements WorkService {
    @Autowired
    private  WorkMapper workMapper;
    @Override
    public List<Work> getTotal(Work workInfo) {
        List<Work> workInfos=workMapper.getTotal(workInfo);
        return workInfos;
    }
    @Override
    public List<Work> getAll(Long page,Long limit,Work workInfo) {
        List<Work> workInfos=workMapper.getAll(page,limit,workInfo);
        return workInfos;
    }

    //进行假删除
    @Override
    public void deleteByWorkNums(List<Long> workNums) {
        workMapper.deleteByWorkNums(workNums);
    }

    //增加一个值班表信息
    @Override
    public void addWork(Work workInfo) {
        workMapper.addWork(workInfo);
    }

    @Override
    public void modifyStatus(Long workNum, Long isFree) {
        workMapper.modifyStatus(workNum,isFree);
    }

    @Override
    public Work getAllByWorkNum(Long workNum) {
        Work  work =  workMapper.getAllByWorkNum(workNum);
        return work;
    }

    @Override
    public void modifyWork(Work workInfo) {
        workMapper.modifyWork(workInfo);
    }

    @Override
    public void modifyWorkNum( Long workNum,Long num) {
        workMapper.modifyWorkNum(workNum,num);
    }
}
